package tec.stan.ling.core.notifier;

import java.util.List;

/**
 * A source of notification delivery.
 *
 * @author Stan 张新潮
 * @date Jan 12, 2010
 */
public interface Notifier {
	 /**
	   * Returns list of the adapters associated with this notifier.
	   * @return the adapters associated with this notifier.
	   */
	  List<Adapter> getAdapters();

	  /**
	   * Returns whether this notifier will deliver notifications to the adapters.
	   * @return whether notifications will be delivered.
	   * @see #setDeliver
	   */
	  boolean isDeliver();

	  /**
	   * Sets whether this notifier will deliver notifications to the adapters.
	   * @param deliver whether or not to deliver.
	   * @see #isDeliver()
	   */
	  void setDeliver(boolean deliver);

	  /**
	   * Notifies a change to a feature of this notifier as described by the notification.
	   * The notifications will generally be {@link #isDeliver() delivered} 
	   * to the {@link #getAdapters adapters}
	   * via {@link Adapter#notifyChanged Adapter.notifyChanged}.
	   * @param notification a description of the change.
	   */
	  void notify(Notification notification);
}
